import {request} from '../../request/index.js'

Page({
  data: {
    swiperList: [],
    categoryList: [],
    floorList: []
  },
  //options(Object)
  onLoad: function(options){
    this.getSwiperList()
    this.getCategoryList()
    this.getFloorList()
  },
  getSwiperList() {
    request({url:'/home/swiperdata'})
    .then(result => {
      this.setData({
        swiperList:result
      })
    })
  },
  getCategoryList() {
    request({url:'/home/catitems'})
    .then(result => {
      this.setData({
        categoryList:result
      })
    })
  },
  getFloorList() {
    request({url:'/home/floordata'})
    .then(result => {
      this.setData({
        floorList:result
      })
    })
  }
});